/*
 *	cents4.2.cpp
 *    Convert input number of nickels, dimes, quarters, pennies, half-dollars, and dollars to cents and dollars.
 *    By Jake Gunter.
 */


#include "stdafx.h"
#include <iostream>
#include <iomanip>
using namespace std;

int main()
{
  double nickels, dimes, cents, dollars, dollars2, quarters, pennies, dollarshalf;
  int i;
  while (true)
  {
  cout<<"Enter Number of nickels: ";
  cin>>nickels;
  cout<<"Enter number of dimes: ";
  cin>>dimes;
  cout<<"Enter number of pennies: ";
  cin>>pennies;
  cout<<"Enter number of quarters: ";
  cin>>quarters;
  cout<<"Enter number of half-dollars: ";
  cin>>dollarshalf;
  cout<<"Enter number of dollars: ";
  cin>>dollars2;
  cents=5*nickels+10*dimes+pennies+25*quarters+50*dollarshalf+100*dollars2;
  dollars=cents/100;
  cout<<nickels<<" nickels, "<<dimes<<" dimes, "<<pennies<<" pennies, "<<quarters<<" quarters, "<<endl;
  cout<<dollarshalf<<" half-dollars, and "<<dollars2<<" dollars equals "<<endl;
  cout<<cents<<" cents, or $";
  cout<<setiosflags(ios::fixed|ios::showpoint)
  <<setprecision(2);
  cout<<dollars<<"."<<endl;
  cout<<setiosflags(ios::fixed|ios::showpoint)
  <<setprecision(0);
  }
  return 0;
}

